{% extends "panel.html" %}

{% load i18n %}
{% load inventree_extras %}
{% load plugin_extras %}

{% block label %}global-notifications{% endblock label %}

{% block heading %}{% trans "Notification Settings" %}{% endblock heading %}

{% block content %}

<div class='row'>
    <table class='table table-striped table-condensed'>
        <thead>
            <th></th>
            <th>{% trans "Name" %}</th>
            <th>{% trans "Slug" %}</th>
            <th>{% trans "Description" %}</th>
        </thead>
        <tbody>
            {% notification_list as methods %}
            {% for method in methods %}
            <tr>
                <td>{% if method.icon %}<span class="fas {{ method.icon }}"></span>{% endif %}</td>
                <td>
                    {{ method.name }}
                    {% if method.plugin %}
                    <a class='sidebar-selector' id='select-plugin-{{method.plugin.slug}}' data-bs-parent="#sidebar">
                        <span class='badge bg-dark badge-right rounded-pill'>{{ method.plugin.slug }}</span>
                    </a>
                    {% endif %}
                </td>
                <td>{{ method.slug }}</td>
                <td>{{ method.description }}</td>
            </tr>
            {% if method.setting %}
            <tr>
                <td colspan="1"></td>
                <td colspan="3">
                    <table class='table table-condensed'>
                        <tbody>
                            {% include "InvenTree/settings/setting.html" with key=method.setting plugin=method.plugin %}
                        </tbody>
                    </table>
                </td>
            </tr>
            {% endif %}
            {% endfor %}
        </tbody>
    </table>
</div>

{% endblock content %}
